package com.ben.multiple.jasypt;

import org.jasypt.util.text.BasicTextEncryptor;

/**
 * @author BenJin Yin
 * @date 2020/7/3
 */
public class JasyptUtil {
    public static void main(String[] args) {
        encode();
        decode();
    }

    private static void decode() {
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword("ben");
        String decrypt = encryptor.decrypt("UxGRDSn1Oc6EnKK3fBJBLw==");
        System.out.println(decrypt);
    }

    private static void encode() {
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword("ben");
        String encrypt = encryptor.encrypt("123456");
        System.out.println(encrypt);
    }
}
